#include<stdio.h>
int n;
int main()
{
    scanf("%d", &n);
	switch(n/10)
	{
		case 10:
		case 9: 
			printf("A");
			break;
		case 8:
			printf("B");
			break;
		case 7:
			printf("C");
			break;
		case 6:
			printf("D");
			break;
		case 4:
		case 3:
		case 2:
		case 1:
		case 0:
		case 5:
			printf("Fail.");
			break;
	}
	return 0;
}
